#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import docker
client = docker.from_env()

print(client.version())


# pull and run images
# print(client.containers.run("alpine", ["echo", "hello", "world"]))


# run images daemon
# container = client.containers.run("alpine:latest", detach=True)
# print(container.id)

# list image
print("images:")
for image in client.images.list():
    print(image.id)

# list container
print("container:")
for container in client.containers.list():
    print(container.id)

## print container logs
container = client.containers.get('0f22d4a2c602d90c4f1e96ead9390b85a6ba41d7e3e26320d4c5eba1e8d367eb')
print(container.logs())

## pull image
# image = client.images.pull("alpine")
# print(image.id)

### delete container
# for container in client.containers.list():




